package com.zhan.rkforum.bean;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.annotation.Resource;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Resource(name = "user")
public class User implements Serializable {
    private int id;
    private String username;
    private String password;
    private String salt;
    private String email;
    private int type;
    private int status;
    private String headerUrl;
    //@JsonFormat(timezone = "GMT+8", pattern ="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    private String activationCode;



    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", email='" + email + '\'' +
                ", type=" + type +
                ", status=" + status +
                ", headerUrl='" + headerUrl + '\'' +
                ", createTime=" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime) + '\'' +
                ", activationCode='" + activationCode + '\'' +
                '}';
    }
}
